﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/administration/Admin.master"
    CodeFile="MergeCompanies.aspx.cs" Inherits="administration_MergeCompanies" %>

<asp:Content ID="contID" runat="server" ContentPlaceHolderID="head">
    <script type="text/javascript">
        function firstCheckAll() {
            var sts = $("#checkOrUncheckAll").attr("checked");
            if (sts == undefined) {
                sts = false;
            }
            //alert(sts);
            $(".firstcheckbox").each(function () {
                $(this).find("input").attr('checked', sts);
            });
        }

        function SecondCheckAll() {
            var sts = $("#checkOrUncheckAllsecond").attr("checked");
            if (sts == undefined) {
                sts = false;
            }
            //alert(sts);
            $(".secondcheckbox").each(function () {
                $(this).find("input").attr('checked', sts);
            });
        }
    </script>
</asp:Content>
<asp:Content ID="sconID" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <div style="width: 100%">
        <div style="width: 40%; float: left">
            <span>Company ID</span>
            <input id="firstCompany" runat="server" type="text" class="text err" />
            <%-- <asp:Button Text="Find" CssClass="button" runat="server" ID="fFindID" OnClick="fFindID_Click" />--%>
        </div>
        <div style="width: 36%; float: right">
            <span>Company ID</span>
            <input id="secondCompany" runat="server" type="text" class="text err" />
            <asp:Button ID="SFindID" Text="Find" Width="45px" Height="20px" ForeColor="White" BackColor="Black"
                runat="server" OnClick="SFindID_Click" />
        </div>
    </div>
    <div style="width: 100%">
        <div style="width: 40%; float: left">
            <asp:Button ID="DeletefirstCompany" CssClass="button" runat="server" Text="წაშალე კომპანია"
                OnClick="DeletefirstCompany_Click" />
            <asp:Button ID="MoveRight" runat="server" Text=">>>" CssClass="button" OnClick="MoveRight_Click" />
            <div>
                <img src="" alt="" id="firstCompanyImage" runat="server" style="margin-top: 2px;
                    width: 80px; height: 35px" visible="false" />
                <br />
                <a href="#" runat="server" id="firstCompanyLink"></a>
            </div>
            <asp:GridView ID="firstGridView" runat="server" Width="200px" Style="margin-left: 0"
                AutoGenerateColumns="False">
                <Columns>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            <input type="checkbox" id="checkOrUncheckAll" class="checkOrUncheckAll" onclick="firstCheckAll()" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox ID="CheckBoxLeft" CssClass="firstcheckbox" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="ReviewID" HeaderText="ReviewID" ReadOnly="True" />
                    <asp:TemplateField HeaderText="რევიო">
                        <ItemTemplate>
                            <asp:Label ID="Label1" Text='<%#(Eval("Review1")).ToString().Length > 5 ? (Eval("Review1")).ToString().Substring(0,5)+"..":(Eval("Review1")).ToString() %>'
                                runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <%--<asp:BoundField DataField="Company.Name" HeaderText="კომპანია" ReadOnly="True" />--%>
                    <asp:BoundField DataField="User.FirstName" HeaderText="მომხმარებელი" ReadOnly="True" />
                    <%--<asp:BoundField DataField="Gallery.Name" HeaderText="სურათი" ReadOnly="True" />--%>
                    <asp:BoundField DataField="CreateDate" HeaderText="შექ.თარღი" ReadOnly="True" />
                </Columns>
            </asp:GridView>
        </div>
        <div style="width: 36%; float: right;">
            <asp:Button ID="MoveLeft" runat="server" CssClass="button" Text="<<<" OnClick="MoveLeft_Click" />
            <asp:Button ID="DeleteSecondCompany" CssClass="button" runat="server" Text="წაშალე კომპანია"
                OnClick="DeleteSecondCompany_Click" />
            <div>
                <img src="" alt="" id="secondCompanyImage" runat="server" style="margin-top: 2px;
                    width: 80px; height: 35px" visible="false" />
                <br />
                <a href="#" runat="server" id="secondCompanyLink"></a>
            </div>
            <asp:GridView ID="secondGridView" runat="server" Width="200px" Style="margin-left: 0"
                AutoGenerateColumns="False">
                <Columns>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            <input type="checkbox" id="checkOrUncheckAllsecond" class="checkOrUncheckAllsecond"
                                onclick="SecondCheckAll()" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox ID="CheckBoxRight" CssClass="secondcheckbox" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="ReviewID" HeaderText="ReviewID" ReadOnly="True" />
                    <asp:TemplateField HeaderText="რევიო">
                        <ItemTemplate>
                            <asp:Label ID="Label1" Text='<%# (Eval("Review1")).ToString().Length > 5 ? (Eval("Review1")).ToString().Substring(0,5)+"..":(Eval("Review1")).ToString() %>'
                                runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <%--<asp:BoundField DataField='<%# Left(Eval("Review1"),60) %>' HeaderText="რევიო" ReadOnly="True" />--%>
                    <%--<asp:BoundField DataField="Company.Name" HeaderText="კომპანია" ReadOnly="True" />--%>
                    <asp:BoundField DataField="User.FirstName" HeaderText="მომხმარებელი" ReadOnly="True" />
                    <%--<asp:BoundField DataField="Gallery.Name" HeaderText="სურათი" ReadOnly="True" />--%>
                    <asp:BoundField DataField="CreateDate" HeaderText="შექ.თარღი" ReadOnly="True" />
                </Columns>
            </asp:GridView>
        </div>
    </div>
</asp:Content>
